Micron Document
🎖️GitЯра🎖️

Node / meshtastic / Meshtastic-Android / files / gradle / build-cache.settings.gradle

Displaying Raw • Download

gradle/build-cache.settings.gradle 988db081b289cbc23d9bceef8e7d85ab46d0e6a4 (988db081) Text, 2.79 KB

T8b949e/*
* Copyright (c) 2025 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

Tffa657def Td2a8ffgetMeshPropertyTff7b72(Te6edf3String Te6edf3keyTff7b72) Tff7b72{
Tffa657def Te6edf3env Tff7b72= Te6edf3SystemTff7b72.Td2a8ffgetenvTff7b72(Te6edf3keyTff7b72)
Tff7b72if Tff7b72(Te6edf3envTff7b72) Tff7b72return Te6edf3env

Tffa657def Te6edf3currentDir Tff7b72= Te6edf3settingsDir
Tff7b72while Tff7b72(Te6edf3currentDir Tff7b72!Tff7b72= Tff7b72nullTff7b72) Tff7b72{
Tffa657def Te6edf3localFile Tff7b72= Tff7b72new Te6edf3FileTff7b72(Te6edf3currentDirTff7b72, Ta5d6ff"local.properties"Tff7b72)
Tff7b72if Tff7b72(Te6edf3localFileTff7b72.Td2a8ffexistsTff7b72(Tff7b72)Tff7b72) Tff7b72{
Tffa657def Te6edf3props Tff7b72= Tff7b72new Te6edf3PropertiesTff7b72(Tff7b72)
Te6edf3localFileTff7b72.Td2a8ffwithInputStream Tff7b72{ Te6edf3propsTff7b72.Td2a8ffloadTff7b72(Te6edf3itTff7b72) Tff7b72}
Tff7b72if Tff7b72(Te6edf3propsTff7b72.Td2a8ffcontainsKeyTff7b72(Te6edf3keyTff7b72)Tff7b72) Tff7b72return Te6edf3propsTff7b72.Td2a8ffgetPropertyTff7b72(Te6edf3keyTff7b72)
Tff7b72}
Tffa657def Te6edf3configFile Tff7b72= Tff7b72new Te6edf3FileTff7b72(Te6edf3currentDirTff7b72, Ta5d6ff"config.properties"Tff7b72)
Tff7b72if Tff7b72(Te6edf3configFileTff7b72.Td2a8ffexistsTff7b72(Tff7b72)Tff7b72) Tff7b72{
Tffa657def Te6edf3props Tff7b72= Tff7b72new Te6edf3PropertiesTff7b72(Tff7b72)
Te6edf3configFileTff7b72.Td2a8ffwithInputStream Tff7b72{ Te6edf3propsTff7b72.Td2a8ffloadTff7b72(Te6edf3itTff7b72) Tff7b72}
Tff7b72if Tff7b72(Te6edf3propsTff7b72.Td2a8ffcontainsKeyTff7b72(Te6edf3keyTff7b72)Tff7b72) Tff7b72return Te6edf3propsTff7b72.Td2a8ffgetPropertyTff7b72(Te6edf3keyTff7b72)
Tff7b72}
Te6edf3currentDir Tff7b72= Te6edf3currentDirTff7b72.Td2a8ffparentFile
Tff7b72}
Tff7b72return Tff7b72null
Tff7b72}

Te6edf3buildCache Tff7b72{
Te6edf3local Tff7b72{
Te6edf3enabled Tff7b72= Tff7b72true
Tff7b72}
Te6edf3remoteTff7b72(Te6edf3HttpBuildCacheTff7b72) Tff7b72{
T8b949e// Some servers have issues with Expect: 100-continue and return 403.
Te6edf3useExpectContinue Tff7b72= Tff7b72false
Tffa657def Te6edf3cacheUrl Tff7b72= Te6edf3getMeshPropertyTff7b72(Ta5d6ff"GRADLE_CACHE_URL"Tff7b72)Tff7b72?Tff7b72.Td2a8fftrimTff7b72(Tff7b72)
Tffa657def Te6edf3cacheUsername Tff7b72= Te6edf3getMeshPropertyTff7b72(Ta5d6ff"GRADLE_CACHE_USERNAME"Tff7b72)Tff7b72?Tff7b72.Td2a8fftrimTff7b72(Tff7b72)
Tffa657def Te6edf3cachePassword Tff7b72= Te6edf3getMeshPropertyTff7b72(Ta5d6ff"GRADLE_CACHE_PASSWORD"Tff7b72)Tff7b72?Tff7b72.Td2a8fftrimTff7b72(Tff7b72)

Tff7b72if Tff7b72(Te6edf3cacheUrlTff7b72) Tff7b72{
Tffa657def Te6edf3isLogic Tff7b72= Te6edf3settingsDirTff7b72.Td2a8ffname Tff7b72=Tff7b72= Ta5d6ff"build-logic"
Te6edf3loggerTff7b72.Td2a8fflifecycle Ta5d6ff"Meshtastic ${isLogic ? 'Build Logic' : 'Build'}: Remote cache URL found."

T8b949e// Ensure trailing slash for cache servers
Te6edf3url Tff7b72= Te6edf3cacheUrlTff7b72.Td2a8ffendsWithTff7b72(Ta5d6ff"/"Tff7b72) Tff7b72? Te6edf3cacheUrl Tff7b72: Ta5d6ff"${cacheUrl}/"

Tff7b72if Tff7b72(Te6edf3cacheUsername Tff7b72&Tff7b72& Te6edf3cachePasswordTff7b72) Tff7b72{
Te6edf3credentials Tff7b72{
Te6edf3username Tff7b72= Te6edf3cacheUsername
Te6edf3password Tff7b72= Te6edf3cachePassword
Tff7b72}
Tff7b72}

Te6edf3allowInsecureProtocol Tff7b72= Tff7b72true
Te6edf3allowUntrustedServer Tff7b72= Tff7b72true

T8b949e// Keep push enabled if credentials are provided.
T8b949e// This naturally disables push for fork PRs which don't have access to secrets.
Te6edf3push Tff7b72= Tff7b72(Te6edf3cacheUsername Tff7b72&Tff7b72& Te6edf3cachePasswordTff7b72)

Te6edf3enabled Tff7b72= Tff7b72true
Tff7b72} Tff7b72else Tff7b72{
Te6edf3enabled Tff7b72= Tff7b72false
Tff7b72}
Tff7b72}
Tff7b72}

Served by rngit 1.5.0 - Generated in 0.07s